<HTML>
  <HEAD>
    <TITLE>MiAi GO - SGF Page</TITLE>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <style type="text/css">
      @import url(/dojo/1.4.0/dojo/resources/dojo.css);
      @import url(/dojo/1.4.0/dijit/themes/dijit.css);
      @import url(/dojo/1.4.0/dijit/themes/tundra/tundra.css);
      @import url(/miaigo/css/miai.css);
    </style>
    <script type="text/javascript">
      var djConfig = {parseOnLoad: true, isDebug: true};
    </script>
    <script type="text/javascript" src="/dojo/1.4.0/dojo/dojo.js.uncompressed.js"></script>
    <script type="text/javascript">
      dojo.registerModulePath("miaigo", "/miaigo/js/miaigo");
      dojo.require("miaigo.model.Collection");
      dojo.require("miaigo.controller.BaseController");
      dojo.require("miaigo.layout.RecordPlayer");

      function init()
      {
        var sgfURL = "sgf/sample1.sgf";        
        var gameCollection = new miaigo.model.Collection();
        var controller = new miaigo.controller.BaseController();

        gameCollection.load(
        {
          gameURL: sgfURL,
          onError: function(errorString) { alert(errorString); },
          onLoad: function(games) { controller.addCollection(gameCollection); }//,
          // onProgress: function(progress) { dojo.byId("startBtn").innerHTML = progress; }
        });

        var layout = new miaigo.layout.RecordPlayer
        (
          {
            style: "width: 100%; height: 100%;",
            controller: controller
          },
          "miaiLayout"
        );
        layout.startup();
      }

      dojo.addOnLoad(init);

    </script>
  </HEAD>
  <BODY class="tundra">
    <div id="miaiLayout"></div>
  </BODY>
</HTML>
